// git url: https://gitee.com/moran96/TencentCloud.git

const http = require('http');
const hostname = '0.0.0.0';
// const hostname = '127.0.0.1'
const port = 3000;

const data = {
  name: "Tom",
  age: "100",
  food: "milk"
}

const server = http.createServer((req, res) => { 
    res.statusCode = 200;
    // res.header('Access-Control-Allow-Origin', '*');
    res.setHeader('Content-Type', 'application/json;charset=utf-8');
    res.end(JSON.stringify(data));
}); 

server.listen(port, hostname, () => { 
    console.log(`Server running at http://${hostname}:${port}/`);
});